-- import ipc (命令行入口)
-- require("hs.ipc")

-- stackline (yabai stack展示图标)
-- stackline = require "stackline"
-- stackline:init()

-- activate chrome open a new tab
-- hs.hotkey.bind({'cmd', 'alt', 'ctrl', 'shift'}, 'o', function()
-- 	hs.osascript.applescriptFromFile('openNewChromeTab.applescript')
-- end)

-- 窗口管理
require "window.window"


-- 组合键⌘⌥⌃e的时候，在屏幕正中间显示Hello World!这段文本
-- hs.hotkey.bind({"cmd", "alt", "ctrl"}, "E", function()
--   hs.alert.show("Hello World!")
-- end)

-- 使用 Do Shell Script 命令将 UNIX shell 脚本命令发送到“终端”。
-- hs.hotkey.bind({"alt", "ctrl"}, "b", function()
--   hs.osascript.applescript(string.format('do shell script "%s"', 'mkdir -p ~/Desktop/test'))
-- end)

--------------------------------
-- cammand CONFIG
--------------------------------
-- 打开启动器
-- hs.hotkey.bind({"cmd", "shift"}, "space", function()
hs.hotkey.bind({"ctrl","cmd"}, "space", function()
    hs.osascript.applescript('do shell script "open /System/Applications/Launchpad.app"')
end)

-- 打开 终端 快捷键
-- hs.hotkey.bind({"cmd", "shift"}, "enter", function()
hs.hotkey.bind({"cmd", "shift"}, "t", function()
    -- hs.osascript.applescript('do shell script "open /System/Applications/Utilities/Terminal.app"')
    -- hs.osascript.applescript('do shell script "open /Applications/iTerm.app"')
    hs.osascript.applescript('do shell script "open /Applications/kitty.app"')
end)

-- 打开 文件管理器
-- hs.hotkey.bind({"cmd"}, "e", function()
--     -- Shells 中有 open 命令可以直接打开 Finder
--     -- hs.osascript.applescript('do shell script "open ."')
--     -- hs.osascript.applescript('do shell script "open /Applications/Sublime\\ Text.app"')
--     -- hs.osascript.applescript('do shell script "open /Applications/Visual Studio Code.app"')
--     hs.osascript.applescript('do shell script "open /Applications/Feem.app"')
-- end)

